package IngresoAlSistema;


import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author carlosfos
 */
public class VentanaIngresoAlSistema extends javax.swing.JFrame {
    /**
     * Creates new form VentanaIngresoAlSistema
     */
    public VentanaIngresoAlSistema() {       
        
        inicializarVentana();
    }
    
    public void inicializarVentana(){
        
        initComponents();
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setResizable(false);
        this.setLocationRelativeTo(null);
        
        try{
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
            SwingUtilities.updateComponentTreeUI(this);
        
        }
        catch(Exception exception){
            System.out.println("NO SE PUEDE CAMBIAR EL ASPECTO");
        }
    
    
    }
    
    public void asignarActionListener(ActionListener actionListener){
        
        
        botonIngresar.addActionListener(actionListener);
        botonSalir.addActionListener(actionListener);
        
    
    }
    
    public JTextField getCampoLogin() {
        return campoLogin;
    }

    public JPasswordField getCampoPassword() {
        return campoPassword;
    }
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        panelInfo = new javax.swing.JPanel();
        labelLogin = new javax.swing.JLabel();
        campoLogin = new javax.swing.JTextField();
        labelPassword = new javax.swing.JLabel();
        campoPassword = new javax.swing.JPasswordField();
        labelImagenLogo = new javax.swing.JLabel();
        botonIngresar = new javax.swing.JButton();
        botonSalir = new javax.swing.JButton();
        labelImagenFondo = new javax.swing.JLabel();
        labelImagenLogo1 = new javax.swing.JLabel();
        imagenFonfo = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(661, 505));
        getContentPane().setLayout(null);

        panelInfo.setOpaque(false);
        panelInfo.setLayout(new java.awt.GridLayout(2, 2, 0, 25));

        labelLogin.setBackground(new java.awt.Color(164, 158, 151));
        labelLogin.setFont(new java.awt.Font("Dialog", 1, 22)); // NOI18N
        labelLogin.setForeground(new java.awt.Color(254, 254, 254));
        labelLogin.setText("Login:");
        panelInfo.add(labelLogin);
        panelInfo.add(campoLogin);

        labelPassword.setFont(new java.awt.Font("Dialog", 1, 22)); // NOI18N
        labelPassword.setForeground(new java.awt.Color(254, 254, 254));
        labelPassword.setText("Password:");
        panelInfo.add(labelPassword);
        panelInfo.add(campoPassword);

        getContentPane().add(panelInfo);
        panelInfo.setBounds(100, 220, 449, 100);

        labelImagenLogo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/logo.jpg"))); // NOI18N
        getContentPane().add(labelImagenLogo);
        labelImagenLogo.setBounds(470, 30, 160, 140);

        botonIngresar.setText("Ingresar");
        getContentPane().add(botonIngresar);
        botonIngresar.setBounds(130, 400, 150, 40);

        botonSalir.setText("Salir");
        getContentPane().add(botonSalir);
        botonSalir.setBounds(370, 400, 150, 40);

        labelImagenFondo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/logoInicio.gif"))); // NOI18N
        getContentPane().add(labelImagenFondo);
        labelImagenFondo.setBounds(220, 30, 230, 140);

        labelImagenLogo1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/logo.jpg"))); // NOI18N
        getContentPane().add(labelImagenLogo1);
        labelImagenLogo1.setBounds(30, 30, 160, 140);

        imagenFonfo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/fondo104.jpg"))); // NOI18N
        getContentPane().add(imagenFonfo);
        imagenFonfo.setBounds(0, 0, 660, 500);

        pack();
    }// </editor-fold>//GEN-END:initComponents

   
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton botonIngresar;
    private javax.swing.JButton botonSalir;
    private javax.swing.JTextField campoLogin;
    private javax.swing.JPasswordField campoPassword;
    private javax.swing.JLabel imagenFonfo;
    private javax.swing.JLabel labelImagenFondo;
    private javax.swing.JLabel labelImagenLogo;
    private javax.swing.JLabel labelImagenLogo1;
    private javax.swing.JLabel labelLogin;
    private javax.swing.JLabel labelPassword;
    private javax.swing.JPanel panelInfo;
    // End of variables declaration//GEN-END:variables
}
